package j03sort;

import java.util.Arrays;

public class J01Xuaze1 {
    public static void main(String[] args) {
        int[] arr = {67, 42, 88, 16, 25, 3};

        //外层循环，一次ok一个
        for (int i = 0; i <= arr.length-2; i++) {
            // 依次与后面的每一个比较
            for (int j = i+1; j <= arr.length-1; j++) {
                //发现后面有更小的，交换位置
                if(arr[j]<arr[i]){
                    int temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                }
            }
        }

        System.out.println(Arrays.toString(arr));
    }
}
